var SlideHorizontal = Class.create();
SlideHorizontal.prototype = {
    initialize: function(target, initial_width){
        this.is_shown = true;
        this.target = $(target);
        this.initialWidth = initial_width;
    },
    hide: function(){
        this.target.style.height= this.target.getHeight()+'px';
        this.target.morph('width:0px',{
        	afterFinish:function(){
        		console.debug(this);
        		this.target.hide();
        	}.bind(this)
            })
        this.is_shown = false;
    },
    show: function(){
        this.target.show();
        this.target.morph('width:'+this.initialWidth+'px');
        this.is_shown = true;
    },
    toggle: function(){
        if(this.is_shown){
            this.hide();
        } else {
            this.show();
        }
    }
}